﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Farigola.Engine;
using Farigola.Engine.TestUnit;
using Farigola.Engine.PersistXml.TestUnit;

namespace DevTestApp
{
    /// <summary>
    /// Tto dev and debug tests (unit tests and others).
    /// </summary>
    class Program
    {
        static void TestEngineTestUnit()
        {
            EngineTestUnit engTU = new EngineTestUnit();
            engTU.CreateEngineInit();
        }

        static void TestEntityIdTestUnit()
        {
            EntityIdTestUnit ent = new EntityIdTestUnit();
            ent.testIdEquals();
        }

        static void TestEntityString()
        {
            EntityStringTestUnit estu = new EntityStringTestUnit();
            estu.testEntStringSetVal();
        }

        static void TestEntityStructList()
        {
            EntityStructListTestUnit ent = new EntityStructListTestUnit();
            ent.CreateListofStringAddItem();
        }

        //=====================================================================
        #region Test Persist.

        //---------------------------------------------------------------------
        static void TestSaveLoad()
        {
            EngineRepositXmlTestUnit engRepositXmlTestUnit = new EngineRepositXmlTestUnit();
            //engRepositXmlTestUnit.SaveLoadProjectEmpty();
            //engRepositXmlTestUnit.SaveLoadProjectEmpty();
            //engRepositXmlTestUnit.SaveLoadProjectEmpty();

            //engRepositXmlTestUnit.SaveProjectEmptyCloseActiveProject();
            
            //engRepositXmlTestUnit.SavePrjButFileNameWrong();

            //engRepositXmlTestUnit.LoadPrjButFileNotExists();

            //engRepositXmlTestUnit.SaveLoadProjectEmptyCheckContent();
            engRepositXmlTestUnit.SaveLoadProjectOneEntInstString();

        }

        #endregion

        //---------------------------------------------------------------------
        /// <summary>
        /// The main entry, to test code in testUnit.
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            //TestEngineTestUnit();
            //TestEntityIdTestUnit();
            //TestEntityString();
            //TestEntityStructList();
            //return;

            //--persist
            TestPersistProject testPersistProject = new TestPersistProject();

            //testPersistProject.TestSaveAndLoadProject();
            //testPersistProject.TestLoadProject();
            //testPersistProject.TestTheTestUnit();

            TestSaveLoad();
        }
    }
}
